package com.hanoiwiki.manager.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.hanoiwiki.dao.LogDAO;
import com.hanoiwiki.exception.DataAccessException;
import com.hanoiwiki.manager.LogManager;
import com.hanoiwiki.model.Log;

@Component
@Transactional
public class LogManagerImpl extends BaseManagerImpl implements LogManager{
	@Autowired
	private LogDAO logDAO;

	@Override
	public void save(Log log) {
		try {
			logDAO.save(log);
		} catch (DataAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@Override
	public void update(Log log) {
		try {
			logDAO.update(log);
		} catch (DataAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}

	@Override
	public Log get(Integer id) {
		try {
			return logDAO.get(id);
		} catch (DataAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}

	@Override
	public List<Log> getList() {
		try {
			return logDAO.getList();
		} catch (DataAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}

	@Override
	public void remove(Integer id) {
		try {
			logDAO.remove(id);
		} catch (DataAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
}
